<template>
<div>
  <h1 v-text="msg" ref="title"></h1>
  <button @click="showDOM">点我输出上分dom元素</button>
<School ref="sch"></School>
</div>
</template>

<script>
import School from "@/components/School";

export default {
  name: "App",
  components:{
    School,
  },
  data(){
    return{
      msg:"欢迎学习vue",
    }
  },
  methods:{
    showDOM(){
      console.log(this.$refs.title)//真实dom元素
      console.log(this.$refs.sch)//school实例对象
    }
  }
}
</script>

<style scoped>

</style>
